import NavBar from '@/components/menus/NavBar';
import EditList from '@/components/user/EditList';
import { InputListProps } from '@/types/props';
import { formatContact } from '@/utils';
import { getUser } from '@/utils/auth';
import { View } from '@tarojs/components';

export default () => {
  const user = getUser();
  const opt: Array<InputListProps> = [
    {
      label: '密码',
      popup: 'code',
      value: '已设定',
    },
    {
      label: '手机号码',
      popup: 'phone',
      value: formatContact(user.phone),
    },
    {
      label: 'Email',
      popup: 'email',
      value: formatContact(user.email),
    },
  ];
  return (
    <NavBar title="账号安全中心">
      <View>
        <EditList options={opt} />
      </View>
    </NavBar>
  );
};
